package org.jeecg.modules.user.customer.controller;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.jeecg.common.system.base.controller.JeecgController;
import org.jeecg.modules.system.problem.entity.BikeProblem;
import org.jeecg.modules.system.problem.entity.BikeProblemAppeal;
import org.jeecg.modules.user.customer.service.ProblemService;
import org.jeecg.modules.utils.BikeResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletRequest;

/**
* @Description: bike_pile
* @Author: jeecg-boot
* @Date:   2021-05-19
* @Version: V1.0
*/
@Api(tags="联系客服")
@RestController
@RequestMapping("/app/proble")
@Slf4j
public class ProblemController extends JeecgController<BikeProblem, ProblemService> {

   @Autowired
   private ProblemService problemService;


   /**
    *   常见问题
    * @param
    * @return
    */
   @ApiOperation(value="常见问题", notes="常见问题")
   @GetMapping(value = "/getProblemList")
   public BikeResult getProblemList(@RequestParam(value = "id",required = false) String id,@RequestParam(value = "pageNum",required = false)Integer pageNum,@RequestParam(value = "pageSize",required = false)Integer pageSize) {
      return problemService.getProblemList(id,pageNum,pageSize);
   }

   /**
    *   提交诉求
    * @param
    * @return
    */
   @ApiOperation(value="提交诉求", notes="提交诉求")
   @PostMapping(value = "/submitAppeal")
   public BikeResult submitAppeal(@RequestBody BikeProblemAppeal bikeProblemAppeal, HttpServletRequest request) {
      return problemService.submitAppeal(bikeProblemAppeal,request);
   }

   /**
    *   诉求详情
    * @param
    * @return
    */
   @ApiOperation(value="诉求详情", notes="诉求详情")
   @GetMapping(value = "/getAppealList")
   public BikeResult getAppealList(@RequestParam(value = "id",required = false) String id,@RequestParam("processStatus")String processStatus,@RequestParam(value = "pageNum",required = false)Integer pageNum,@RequestParam(value = "pageSize",required = false)Integer pageSize,HttpServletRequest request) {
      return problemService.getAppealList(id,processStatus,pageNum,pageSize,request);
   }



}
